const {ccclass, property} = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {

    @property(cc.Prefab)
    pumple: cc.Prefab = null;

    


    
    // LIFE-CYCLE CALLBACKS:

    // onLoad () {}

    start () {
        
    }

    // update (dt) {}

    spawnPumple(){
        let pumple = cc.instantiate(this.pumple)
        let pumpleLayer = this.node.getChildByName("pumpleLayer")
        pumpleLayer.addChild(pumple)
    
        pumple.emit("init")
    }

    startGame(){ //开始游戏的时候再生成柱子
        this.schedule(this.spawnPumple,1.5)
    }
}
